Discover open ports and associated services in Windows

Discover Open Ports In Windows

We can do this using netstat (network statistics) command in powershell or cmd.

It is used to display:

  1. Open cmd (command prompt) and type:

netstat /?

To get help about the command

40f1dd2f307674c9e02e848a1541287a.png

  1. netstat -ano

d7ec82c9e7809f5ca5f883c40f8d7090.png

  1. Use -b to display the .exe file associated with each connection.

f7a92753820083cf651b29125b046545.png


Tracing The Services Or Processes associated with the ports

  1. Open Task Manger and go to services tab
  2. Sort it by PID (Process ID)
  3. Select the required PID (like 4424)

8f7d5f6e2f8d8eb2b8029d73a4bfebc3.png

  1. Right Click>Go to details
  2. In Details tab, Right Click>properties

1e6cffe0405283f741d4d0806b3146b4.png

  1. This will open up properties of the executable (.exe) associated with the service.

ff4db0dc60fdf618ab465b2bd82ace41.png

  1. Here we can see mqsvc.exe (Message Queuing Service) with PID 4424 using the ports 1801,2103/5/7.